# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-railroad-diagrams
pkgver=3.0.1
_commit=c3a16b9dcb06f5d0ae2260f8414136917871d4c5
pkgrel=2
pkgdesc="Generate SVG railroad syntax diagrams, like on JSON.org."
url="https://github.com/tabatkins/railroad-diagrams"
license=('MIT')
arch=('any')
depends=('python')
makedepends=('git' 'python-setuptools')
source=("git+https://github.com/tabatkins/railroad-diagrams.git#commit=$_commit")
sha512sums=('SKIP')

build() {
  cd railroad-diagrams
  python setup.py build
}

check() {
  cd railroad-diagrams
  python railroad.py
}

package() {
  cd railroad-diagrams
  python setup.py install --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
